{include file="./public/header" title="用户列表"/}
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/datatables/css/dataTables.bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/datatables-buttons/css/buttons.dataTables.min.css"/>
<link rel="stylesheet" type="text/css"
      href="__STATIC__/lib/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
<link href="https://cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">
<style>
    .selected {
        background-color: #D9EDF7;
    }
</style>

<body class="hold-transition skin-blue fixed sidebar-mini">
<div class="wrapper">

    {include file="./public/navi"/}

    <!--页面主体-->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 后台</a></li>
                <li class="active">用户列表</li>
            </ol>
        </section>

        <section class="content">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">用户列表</h3>
                    <div class="box-tools">
                        <button onclick="javascript:location.reload();" type="button"
                                class="btn btn-box-tool"><i class="fa fa-refresh"></i> 刷新
                        </button>
                        <a href="create.html" type="button" class="btn btn-box-tool"><i
                                class="fa fa-plus"></i> 新增
                        </a>
                        <button id="edit-btn" type="button" class="btn btn-box-tool"><i
                                class="fa fa-pencil"></i> 修改
                        </button>
                        <button id="delete-btn" type="button" class="btn btn-box-tool"><i
                                class="fa fa-trash-o fa-fw"></i> 删除
                        </button>
                    </div>
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body  table-responsive">
                    <table id="table" class="table table-condensed table-bordered">
                        <thead class="">
                        <tr>
                            <th class="text-center">ID</th>
                            <th class="text-center">用户名称</th>
                            <th class="text-center">所属用户组</th>
                            <th class="text-center">所属品牌</th>
                            <th class="text-center">队伍</th>
                            <th class="text-center">状态</th>
                            <th class="text-center" width="20%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="userList" id="user"}
                        <tr>
                            <td align="center">{$user.id}</td>
                            <td align="center">{$user.username}</td>
                            <td align="center">{$user.title}</td>
                            <td align="center">{$user.brand}</td>
                            <td align="center">{$user.team}</td>
                            <td align="center">
                                <a href="javascript:void(0);" data-id="{$user.id}" data-field="status"
                                   data-value="{$user.status}" data-url="{:url('changeStatus', 'id='.$user['id'])}"
                                   class='changeStatus fa {if condition=" $user.status == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'>
                                </a>
                            </td>
                            <td align="center">
                                <a href="{:url('edit',array('id'=>$user['id']))}" class="btn btn-primary btn-xs">
                                    <i class="fa fa-pencil"></i> 编辑
                                </a>
                                <a href="javascript:if(confirm('确定删除？'))location='{:url('delete',array('id'=>$user['id']))}'"
                                   class="btn btn-danger btn-xs">
                                    <i class="fa fa-trash-o"></i> 删除
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </section>
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

{include file="public/js"/}
<script src="__STATIC__/lib/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script src="__STATIC__/lib/datatables/js/jquery.dataTables.min.js"></script>
<script src="__STATIC__/lib/datatables/js/dataTables.bootstrap.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/jszip.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="__STATIC__/lib/datatables-buttons/js/buttons.print.min.js"></script>

<script>
    /*    $('[name="status"]').bootstrapSwitch({
            onColor: "success",
            offColor: "default",
            size: "small",
            onSwitchChange: function (event, state) {
                if (state == true) {
                    $(this).val("1");
                } else {
                    $(this).val("2");
                }
            }
        })*/
</script>
</body>

</html>